<?php
namespace App\Model\User\V1;

//use PhalApi\Model\NotORMModel as NotORM;

use think\Model;

class UserModel extends Model{

    /* protected function getTableName($id) {
        return 'curd';
    } */
    
    //参考TP5.1的完全开发手册数据库章节 https://www.kancloud.cn/manual/thinkphp5_1/353998
    
    protected $name = 'user';
    //protected $table = 'tbl_user';

    public function index() {
       $user = $this->where('id', 2)->find();
        var_dump($user);die;
        
        $data = array(
            'username' => 'xiaoming',
            'createtime' => time(),
            'updatetime' => time(),
        );
        $id = $this->insert($data);
        //$id = $this->insertData($data);
        var_dump($id);
        die;
    }
}
